package com.qingcheng.config;

import com.qingcheng.service.goods.CategoryService;
import com.qingcheng.service.goods.SkuService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author:boy
 * @Date:2019/7/7
 * @description:
 * @ModifiedBy:
 */
@Component
public class Init implements InitializingBean {
    @Autowired
    private CategoryService categoryService;
    @Autowired
    private SkuService skuService;
    public void afterPropertiesSet() throws Exception {
        System.out.println("====分类数据缓存预热====");
        categoryService.saveCategoryTreeToRedis();
        System.out.println("====sku价格数据缓存预热====");
        skuService.saveAllPriceToRedis();
    }
}
